//
//  NYTagCell.m
//  BS
//
//  Created by neal on 15/8/16.
//  Copyright (c) 2015年 Neal. All rights reserved.
//

#import "NYTagCell.h"
#import "NYTagModel.h"
#import <UIImageView+WebCache.h>

@interface NYTagCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageListView;
@property (weak, nonatomic) IBOutlet UILabel *themeNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *subNumberlabel;

@end
@implementation NYTagCell

- (void)awakeFromNib
{
//    self.imageListView.layer.cornerRadius = self.imageListView.width*0.5;
//    self.imageListView.clipsToBounds  =YES;
}
- (void)setTagModel:(NYTagModel *)tagModel
{
    _tagModel = tagModel;
    
    [self.imageListView setHeaderImageWithUrl:tagModel.image_list];
    
    self.themeNameLabel.text = tagModel.theme_name;
    //设置订阅数
    if (tagModel.sub_number < 10000) {
        self.subNumberlabel.text = [NSString stringWithFormat:@"%ld人订阅",tagModel.sub_number];

    } else {
        self.subNumberlabel.text = [NSString stringWithFormat:@"%.1f万人订阅",tagModel.sub_number / 10000.0];
    }
}

//设置分割线
- (void)setFrame:(CGRect)frame
{
    frame.size.height -= 1;
    [super setFrame:frame];
}
@end
